package org.jsystem;


import org.jsystem.tools.CreatePush;
import org.jsystem.tools.LogContainerHttp;

import jsystem.framework.system.SystemObjectImpl;
import junit.framework.Assert;
 
public class ExistedPullSo extends SystemObjectImpl 
{
 
	LogContainerHttp logContainerHttp = new LogContainerHttp();
    private String srcIp = "";
    private String streamName = "";
    private String dstIp = "";
    private String sourceName = "";
    private String latency = "";
    
    final private static String HTTP = "http://";
    final private static String params1 = ":4444/zixi/add_stream.json?func=load_live_inputs&type=pull&id=";
    final private static String params2 = "&max_outputs=-1&mcast_out=0&time_shift=0&old=0&aggr_arq=1&host0=";
    final private static String params3 = "&host1=&host2=&pull-port=2088&source=";
    final private static String params4 = "&password=&latency=";
    final private static String prequestEnd = "&nic=&fec_overhead=30&fec_latency=300&fec_aware=0&fec_adaptive=1&fec_force=0&ie_fooler=0.4661576140206307";
    
    public String getDstIp() {
		return dstIp;
	}

	public void setDstIp(String dstIp) {
		this.dstIp = dstIp;
	}

	public String getSourceName() {
		return sourceName;
	}

	public void setSourceName(String sourceName) {
		this.sourceName = sourceName;
	}

	public String getLatency() {
		return latency;
	}

	public void setLatency(String latency) {
		this.latency = latency;
	}

	
	
	
    public void verifyIfPullCreated()
    {
    	System.out.println(HTTP + srcIp + params1 + streamName + params2 + dstIp + params3 + sourceName + params4 + latency + prequestEnd);
    	
    	CreatePush createpush = new CreatePush();         
		Assert.assertNull(createpush.sendGet(HTTP + srcIp + params1 + streamName + params2 + dstIp + params3 + sourceName + params4 + latency + prequestEnd, logContainerHttp));
		System.out.println(HTTP + srcIp + params1 + streamName + params2 + dstIp + params3 + sourceName + params4 + latency + prequestEnd);
    }

	public String getSrcIp() {
		return srcIp;
	}

	public void setSrcIp(String srcIp) {
		this.srcIp = srcIp;
	}

	public String getStreamName() {
		return streamName;
	}

	public void setStreamName(String streamName) {
		this.streamName = streamName;
	}
 } 